#include "cStateInGame.h"
#include <stdio.h>
#include "VideoDriver.h"
#include "2D/Wall2D.h"
static const Wall2D WALL_LEFT(Vector2D(0.0f,0.0f), Vector2D(0.0f,(double)SCREEN_H));
static const Wall2D WALL_TOP(Vector2D(0.0f,0.0f), Vector2D((double)SCREEN_W,0.0f));
static const Wall2D WALL_RIGHT(Vector2D((double)SCREEN_W,0.0f), Vector2D((double)SCREEN_W,(double)SCREEN_H));
static const Wall2D WALL_BOTTOM(Vector2D(0.0f,(double)SCREEN_H), Vector2D((double)SCREEN_W,(double)SCREEN_H));
static const CBound GAME_BOUND(WALL_LEFT, WALL_TOP, WALL_RIGHT, WALL_BOTTOM);
void CStateInGame::Init()
{
	//m_listObject.push_back(CCircle(Vector2D((double)100,(double)50), 25.0f, 4.0f, Vector2D()));
	m_listObject.push_back(CCircle(Vector2D((double)200,(double)50), 50.0f, 8.0f, Vector2D()));
}

void CStateInGame::Update()
{
	printf(" State In Game: Update");
	std::vector<CCircle>::iterator it;
	for(it = m_listObject.begin();it != m_listObject.end();it++)
	{
		(*it).CheckCollisionWithBound(GAME_BOUND);
		(*it).UpdateWidthBound(GAME_BOUND);
	}
}

void CStateInGame::Render()
{
	VideoDriver::GetInstance()->CleanScreen();
	std::vector<CCircle>::iterator it;
	for(it = m_listObject.begin();it != m_listObject.end();it++)
	{
		(*it).Render();
	}
}

void CStateInGame::Exit()
{
	printf(" State In Game: Exit");
}
